#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>

int main()
{
  //printf("I am running!......\n");
  pid_t id = fork();
  //printf("pid: %d\n", id);
  //sleep(1);
  if(id == 0)
  {
    while(1){
      printf("do child process!...\n");
      sleep(1);
    }
  }
  else if(id > 0)
  {
    while(1)
    {
      printf("do father process!......\n");
      sleep(2);
    }
  }
  else
  {
    printf("fork error\n");
  }

  //while(1){
  //  printf("I am a process : pid : %d , ppid: %d\n",getpid(),getppid());//pid_t fd =  fork();
  //  sleep(1);
  //}
  return 0;
}
